<?
/*

	TEXT/HTML
	Sidebar plugin
	
*/	

	// Tell the system we are a sidebar plugin
	function html_pluginType() { 
		return "sidebar";	
	}
	
	// Tell the system our full name
	function html_pluginName() {
		return "Text/HTML plugin";
	}
	
	// The description of our services as a plugin
	function html_pluginDescription() {
		return "Add any html or javascript to the sidebar";
	}
	
	// can we edit settings?
	function html_hasEdit() {
		return true;
	}
	

	// This is displayed to the user , and should contain all options for setting up the plugin
	//	 presetoptions is an array
	//		either null or contains all the options incase of editing this plugin
	function html_optionForm($presetoptions) {
		if ($presetoptions) $values=explode("|",$presetoptions);

		$form="";

		$form.="Title for widget<br/>";
		$form.="<input type='text' name='title'";
		if ($presetoptions) $form.=" value='".$values[2]."'";
		$form.="/><br/>";

		$form.="Enter the text/html content<br/>";
		$form.="<textarea name='content' rows='10'>";
		if ($presetoptions) $form.=$values[3];
		$form.="</textarea>		";
		
		return $form;
	}


	// Assemble the plugin return string based on the $_POST array values
	//	use | between each setting..  result will be htmlified
	function html_addPlugin() {
		$formline="";
		$formline.=$_POST['content'];
		return $formline;
	}
	
	
	// Print the result !
	function html_draw($line) {
		print "<div class='sidebarcontent'>";
		print stripslashes($line);
		print "</div>";
	}

?>